package com.jeff.tianti.cms.service;

import com.jeff.tianti.cms.entity.Area;
import com.jeff.tianti.cms.dao.AreaDao;
import com.jeff.tianti.cms.dto.AreaQueryDTO;
import com.jeff.tianti.common.service.CommonService;
import com.jeff.tianti.common.entity.PageModel;
import org.springframework.stereotype.Service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author xujianfang
 * @desc AreaService��
 * @date 2019-07-13
 */
@Service
public class AreaService extends CommonService<Area, Integer> {

    @Autowired
    private AreaDao areaDao;

    @Autowired
    public void setAreaDao(AreaDao areaDao) {
        super.setCommonDao(areaDao);
    }

    public PageModel<Area> queryAreaPage(AreaQueryDTO areaQueryDTO) {
        return this.areaDao.queryAreaPage(areaQueryDTO);
    }

    public List<Area> queryAreaList(AreaQueryDTO areaQueryDTO) {
        return this.areaDao.queryAreaList(areaQueryDTO);
    }


    public List<Area> findDistrictByAreaId(String areaId) {
        return this.areaDao.findDistrictByAreaId(areaId);
    }

    public List<Area> getByLevel(Byte level) {
        return this.areaDao.getByLevel(level);
    }

    public Area findByAdcode(String adcode) {
        return this.areaDao.findByAdcode(adcode);
    }
}